﻿using System;
using System.Windows.Input;
using Stationierung.Model;

namespace Stationierung
{
    class DelStationCommandHandle : ICommand
    {
        public bool CanExecute(object parameter)
        {
            return parameter is Station;
        }


        public event EventHandler CanExecuteChanged
        {
            add { CommandManager.RequerySuggested += value; }
            remove { CommandManager.RequerySuggested -= value; }
        }

        public void Execute(object parameter)
        {
            if (parameter is Station)
            {
                App.MainViewModel.DelStation(parameter as Station);
            }
        }
    }
}
